#ifndef __MCOLOR_H__
#define __MCOLOR_H__

typedef unsigned int RGBA;
typedef unsigned int ARGB;

class CMColor
{
	//
	// method 
	//

public:

	// constructor
	explicit CMColor( float fRed = 1.0f , float fGreen = 1.0f , float fBlue = 1.0f , float fAlpha = 1.0f  )
		:
	    r( fRed ) ,
		g( fGreen ) ,
		b( fBlue ) ,
		a( fAlpha )
	{
	}

	inline CMColor& operator=( const CMColor& c )
	{
		r = c.r;
		g = c.g;
		b = c.b;
		a = c.a;

		return *this;
	}

	inline bool operator==( const CMColor& rhs ) const
	{
		if ( r == rhs.r && g == rhs.g && b == rhs.b && a == rhs.a )
		{
			return true;
		}

		return false;
	}

	inline bool operator!=( const CMColor& rhs ) const
	{
		return !( *this == rhs );
	}

	// Retrieves color as RGBA.
	RGBA GetAsRGBA( void ) const;

	// Retrieves color as ARGB.
	ARGB GetAsARGB( void ) const;

	//
	// attribute 
	//

public:

	union
	{
		struct
		{
			float r , g , b , a;
		};

		float c[4];
	};

	static CMColor BLACK;
	static CMColor WHITE;
	static CMColor RED;
	static CMColor GREEN;
	static CMColor BLUE;
};


#endif
